//
//  JHEliminateViewController.m
//  Liberty Voice
//
//  Created by dlios on 15-5-13.
//  Copyright (c) 2015年 ClearLove. All rights reserved.
//

#import "JHEliminateViewController.h"
#import "JHPersonalViewController.h"

@interface JHEliminateViewController ()<UITextFieldDelegate>

@end

@implementation JHEliminateViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
     self.view.backgroundColor = [UIColor whiteColor];
    


    
    UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(20, 60, self.view.frame.size.width - 40, self.view.frame.size.height / 7)];
    textField.placeholder = @"请留下您的宝贵意见,我们会虚心采纳.";
    textField.clearsOnBeginEditing = YES;
    [textField setReturnKeyType:UIReturnKeySend];
    [textField setBorderStyle:UITextBorderStyleBezel];
    [textField setClearButtonMode:UITextFieldViewModeAlways];
    textField.layer.masksToBounds = YES;
    textField.borderStyle = UITextBorderStyleRoundedRect;
    textField.delegate = self;
    textField.tag = 8888;
    [self.view addSubview:textField];
    [textField release];
    
    
    
    UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(self.view.frame.size.width / 1.4 + 10, self.view.frame.size.height / 4, self.view.frame.size.width / 4, self.view.frame.size.height / 4)];
//    button.backgroundColor = [UIColor orangeColor];
    [self.view addSubview:button];
    [button setShowsTouchWhenHighlighted:YES];
    [button setImage:[UIImage imageNamed:@"0089DFD0-0289-4B80-BFA1-7DFF821EB0F9"] forState:UIControlStateNormal];
    [button addTarget:self action:@selector(suggest) forControlEvents:UIControlEventTouchUpInside];
    [button release];

    
    UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
    imageView.image = [UIImage imageNamed:@"6933EEB6-9DF7-4EEE-890F-DCCF38B4FF5F"];
    [self.view addSubview:imageView];
    imageView.alpha = 0.1;
    [imageView release];

    
}
- (void)suggest
{
     UITextField *a = [UITextField alloc];
     a = (UITextField *)[self.view viewWithTag:8888];
    if (![a.text isEqual:@""]) {
        UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:@"亲,非常感谢您的意见,我们会尽快处理" delegate:self cancelButtonTitle:@"确认" otherButtonTitles:nil];
        [self.view addSubview:alertView];
        [alertView show];
        [alertView release];
        [self.navigationController popToRootViewControllerAnimated:YES];
    }else{
        UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:@"亲,您还没留下任何意见哦" delegate:self cancelButtonTitle:@"确认" otherButtonTitles:nil];
        [self.view addSubview:alertView];
        [alertView show];
        [alertView release];
    }
}
- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
    [textField resignFirstResponder];
    return YES;
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
